import sys
from time import time
import random

start = 0

def startTimer():
    global start
    start = time()

def elapsed():
    return time() - start

sys.path.insert(0, ".")
sys.path.insert(0, ".libs")

from pokereval import PokerEval

pokereval = PokerEval()
[a,b,c,d,e] = [12,7,20,24,48]
highs, lows = [], []

def tester():
    strengths = []
    a=random.randint(0,51)
    b=random.randint(0,51)
    c=random.randint(0,51)
    for i in range(52):
        for j in range(i + 1, 52):
            if i != a and i != b and i != c and j != a and j != b and j != c:
                strength = pokereval.poker_eval(game = 'holdem', pockets = [[i, j], [255,255]], board = [a,b,c,255,255], iterations = 1000)['eval'][0]['ev']
                strengths.append(strength)
    strengths.sort()
    highs.append(strengths[len(strengths) - 1])
    lows.append(strengths[0])
    return [strengths[117*i] for i in range(0,11)]

def tester2():
    strengths = []
    a=random.randint(0,51)
    b=random.randint(0,51)
    c=random.randint(0,51)
    d=random.randint(0,51)
    for i in range(52):
        for j in range(i + 1, 52):
            if i != a and i != b and i != c and i != d and j != a and j != b and j != c and j != d:
                strength = pokereval.poker_eval(game = 'holdem', pockets = [[i,j], [255,255]], board = [a,b,c,d,255], iterations = 1000)['eval'][0]['ev']
                strengths.append(strength)
    strengths.sort()
    highs.append(strengths[len(strengths) - 1])
    lows.append(strengths[0])
    return [strengths[112*i] for i in range(0,11)]

def speedTest():
    startTimer()
    for i in range(1000):
        if i % 50 == 0:
            print i
        tester2()
    print elapsed()
